﻿// <copyright file="GameLogicBatchModule.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the GameLogicBatchModule</summary>

namespace Sqwarea.GameLogic
{
    using Autofac.Builder;
    using Sqwarea.GameLogic.Connexity;
    using Sqwarea.GameLogic.TopList;

    /// <summary>
    /// Autofac module for registering GameLogic class for Batch
    /// </summary>
    public class GameLogicBatchModule : Module
    {
        /// <summary>
        /// WARNING : Need Persistence classes.
        /// Registers GameLogic classes for Batch.
        /// </summary>
        /// <param name="moduleBuilder">See Autofac documentation.</param>
        protected override void Load(ContainerBuilder moduleBuilder)
        {
            moduleBuilder.Register<UserStarter>().As<IUserStarter>(); // Needed by AttackSolver
            moduleBuilder.Register<ConnexityProvider>().As<IConnexityProvider>().FactoryScoped();
            moduleBuilder.Register<AttackSolver>().As<IAttackSolver>();
            moduleBuilder.Register<TopListProvider>().As<ITopListProvider>();
            moduleBuilder.Register<KingCleaner>().As<IKingCleaner>();
        }
    }
}
